import successImg from "../img/success.png";
import errorImg from "../img/error.png";
import warningImg from "../img/warning.png";
const Message = {
    success(title, config) {
        uni.showToast({
            ...config,
            title,
            image: successImg,
            duration: config && config.duration || 2000,
            mask: config && config.mask || true,
        })
    },
    error(title, config) {
        uni.showToast({
            ...config,
            title,
            image: errorImg,
            duration: config && config.duration || 2000,
            mask: config && config.mask || true,
        })
    },
    warning(title, config) {
        uni.showToast({
            ...config,
            title,
            image: warningImg,
            duration: config && config.duration || 2000,
            mask: config && config.mask || true,
        })
    },
    other(title, config) {
        uni.showToast({
            ...config,
            title,
            icon: "none",
            duration: config && config.duration || 2000,
            mask: config && config.mask || true,
        })
    }

}

export {
    Message
}